﻿@model MembershipUser

@{ 
    var profile = Model.GetProfile();
   }

<table style="background-color: #ffffff; color: #000000; width: 100%;" cellpadding="5">
    <tr>
        <td style="padding: 10px;">
            <div class="d-avatar">
                <img src="@Model.GetAvatar()" alt="@Model.UserName" />
            </div>
            <h4 style="overflow: hidden;">
                @{var _dispName = string.IsNullOrEmpty(Model.GetDisplayName()) ? Model.UserName : Model.GetDisplayName();}
                @_dispName
                </h4>
            <table style="width: 100%">
                <tr>
                    <td colspan="2">
                        <ul class="ui-helper-reset">
                            @if (!string.IsNullOrEmpty(profile["WebSite"].ToString()))
                               {
                            <li style="float: left; padding: 1px;"><a target="_blank" href="@profile["WebSite"].ToString()">
                                <span class="forum-icon forum-icon-web"></span></a></li>
                            } 
                            @if (!string.IsNullOrEmpty(profile["MSN"].ToString()))
                               {
                            <li style="float: left; padding: 1px;"><a target="_blank" href=""><span class="forum-icon forum-icon-msn">
                            </span></a></li>
                            }
                            @if (!string.IsNullOrEmpty(profile["Yahoo"].ToString()))
                               {
                            <li style="float: left; padding: 1px;"><a target="_blank" href="http://edit.yahoo.com/config/send_webmesg?.target=@profile["Yahoo"].ToString()&.src=pg">
                                <span class="forum-icon forum-icon-yahoo"></span></a></li>
                            }
                            @if (!string.IsNullOrEmpty(profile["Email"].ToString()))
                               {
                            <li style="float: left; padding: 1px;"><a target="_blank" href="javascript:portal.mail('@profile["Email"].ToString()');void(0);">
                                <span class="forum-icon forum-icon-email"></span></a></li>
                            }
                            @if (!string.IsNullOrEmpty(profile["Blog"].ToString()))
                               {
                            <li style="float: left; padding: 1px;"><a target="_blank" href="@profile["Blog"].ToString()">
                                <span class="forum-icon forum-icon-blog"></span></a></li>
                            }
                            @if (!string.IsNullOrEmpty(profile["ICQ"].ToString()))
                               {
                            <li style="float: left; padding: 1px;"><a target="_blank" href="@profile["ICQ"].ToString()">
                                <span class="forum-icon forum-icon-icq"></span></a></li>
                            }
                        </ul>
                    </td>
                </tr>
            </table>
        </td>
        <td valign="top">
            @if (!string.IsNullOrEmpty(profile["Location"].ToString()))
               {
            <p>
                <strong>
                    @Html.Global("RES_LOCATION")</strong>:
                @profile["Location"]
            </p>
            }
            <p>
                <strong>
                    @Html.Global("forums", "Joined")</strong>:
                @Html.Global(Model.CreationDate)
            </p>
            <p>
                <strong>
                   @Html.Global("forums", "LastActivity")</strong>:@Html.Global(profile.LastActivityDate)</p>
            <p>
                <strong>
                    @Html.Global("forums", "Threads") </strong>:
                @profile.GetProfileGroup("Forum")["TotalThreads"]</p>
            <p>
                <strong>
                    @Html.Global("forums", "Posts")</strong>:@profile.GetProfileGroup("Forum")["TotalPosts"]</p>
        </td>
        <td style="width: 200px;">
            @{ Ajax.Dna().ListBox("UserRolesListBox")
                   .HtmlAttributes(new { style = "border:none;" })
                   .Options(opts =>
                   {
                       opts.ShowCheckbox = true;
                   })
                   .Select(Roles.GetRolesForUser(Model.UserName))
                   .Bind(Roles.GetAllRoles())
                   .Render();
                   }
        </td>
    </tr>
</table>
@Html.StartupScripts() 